package demo.xlj.yuyi.studentapp.common;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import demo.xlj.yuyi.studentapp.R;
import demo.xlj.yuyi.studentapp.base.BaseRxActivity;
import demo.xlj.yuyi.studentapp.utils.ActivityUtil;
import demo.xlj.yuyi.studentapp.utils.SharePerferencesUtils;

/**
 * 查看公告界面,所有人都可以看见哦
 */
public class LookAnnouncementActivity extends BaseRxActivity {

    @BindView(R.id.ImageView_back)
    ImageView mImageViewBack;
    @BindView(R.id.TextView_Title)
    TextView mTextViewTitle;
    @BindView(R.id.Textview_Look_Announcement_Two)
    TextView mTextviewLookAnnouncementTwo;
    @BindView(R.id.RelativeLayout_Look_Announcement_activity_one)
    RelativeLayout mRelativeLayoutLookAnnouncementActivityOne;
    @BindView(R.id.RelativeLayout_Look_Announcement_activity_two)
    RelativeLayout mRelativeLayoutLookAnnouncementActivityTwo;
    @BindView(R.id.RelativeLayout_Look_Announcement_activity_three)
    RelativeLayout mRelativeLayoutLookAnnouncementActivityThree;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_look_announcement);
        ButterKnife.bind(this);
        String isWho = (String) SharePerferencesUtils.get(this, "isWho", "99", 0);
        if (isWho.equals("3")){
            mRelativeLayoutLookAnnouncementActivityThree.setVisibility(View.GONE);
        }
        mTextViewTitle.setText("公告通知");
    }


    @OnClick({R.id.ImageView_back, R.id.Textview_Look_Announcement_Two
    ,R.id.RelativeLayout_Look_Announcement_activity_one, R.id.RelativeLayout_Look_Announcement_activity_two, R.id.RelativeLayout_Look_Announcement_activity_three})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.ImageView_back:
                LookAnnouncementActivity.this.finish();
                break;
            case R.id.Textview_Look_Announcement_Two:
                //跳转公告Activity
//                ActivityUtil.openActivityFromLeftToRight(LookAnnouncementActivity.this, LookAnnouncementMoreActivity.class);
                break;
            case R.id.RelativeLayout_Look_Announcement_activity_one:
                //跳转活动公告Acitivyt
                ActivityUtil.openActivityFromLeftToRight(LookAnnouncementActivity.this, LookAnnouncementActMore.class);
                break;
            case R.id.RelativeLayout_Look_Announcement_activity_two:
                //查看的是社团通知
                ActivityUtil.openActivityFromLeftToRightByResult(LookAnnouncementActivity.this, LookAnnouncementMoreActivity.class,"type","3");
                break;
            case R.id.RelativeLayout_Look_Announcement_activity_three:
                //查看的是学生会通知
                ActivityUtil.openActivityFromLeftToRightByResult(LookAnnouncementActivity.this, LookAnnouncementMoreActivity.class,"type","0");
                break;
        }
    }

}
